﻿@model S4Store.Models.ReportBarModel
@{
    Layout = null;
}
<div style=" width:100%; background:#E5EDEF"  ratio="#30">
    <div style=" padding:0 10px">
    @if(!Model.RemoveForm){
        <text><form action="@Url.Action(Model.Action, Model.Controller)"></text>
    }
     <table>
        <tr>
            
        @if (Model.IsView(S4Store.Models.ReportBarModel.ViewItem.Stores))
        {
            <td>
        <select class="storechooser" name="StoreId">
            @foreach (var store in Model.Stores)
            {
                <option  value="@store.Id" @if (Model.Store != null && store.Id == Model.Store.Id)
                                           {<text>selected="selected"</text>}>@store.Name</option>
            }
        </select>
        </td>
        }
        @if (Model.IsView(S4Store.Models.ReportBarModel.ViewItem.Month))
        {
        <td>
            <select class="storechooser" name="Month">
                @for (DateTime dt = DateTime.Now; dt > new DateTime(2013,1,1); dt = dt.AddMonths(-1))
                {
                    <option  value="@dt.ToString("yyyy-MM-01")" @if (dt.Year == Model.Month.Year && dt.Month == Model.Month.Month)
                                                                {<text>selected="selected"</text>}>@dt.ToString("yyyy-MM")</option>
                }
            </select>
        </td>
        }
        @if (Model.IsView(S4Store.Models.ReportBarModel.ViewItem.StartEnd))
        {
        <td>
            @Html.Partial("YmSeleter", new S4Store.Models.YmList { Start = DateTime.Now.AddYears(-1), End = DateTime.Now, Current = Model.Start, Name = "Start" })
            <text>-</text>
            @Html.Partial("YmSeleter", new S4Store.Models.YmList { Start = DateTime.Now.AddYears(-1), End = DateTime.Now, Current = Model.End, Name = "End" })
        </td>
        }
        <td>
        @if (Model.SearchCarBrandId != null)
        {
            <input type="hidden" name="SearchCarBrandId" value="@Model.SearchCarBrandId.Value" />
        }
        @if (Model.SearchCarModelId != null)
        {
            <input type="hidden" name="SearchCarModelId" value="@Model.SearchCarModelId.Value" />
        }
        @if (Model.SearchSellerId != null)
        {
            <input type="hidden" name="SearchSellerId" value="@Model.SearchSellerId.Value" />
        }
        </td>
        @if(Model.IsView(S4Store.Models.ReportBarModel.ViewItem.SubmitButton)){
            <td><input type="button" value="查询" class="reportsubmit" /></td>  
        }
        <td class="plusitem">@Html.Raw(String.IsNullOrEmpty(Model.PlusItem) ? "" : Model.PlusItem)</td>
    </tr>
    </table>
    @if(!Model.RemoveForm){
        <text>@Html.Raw("</form>")</text>
    }
    </div>
</div>